package com.iwhalecloud.bss.kite.cucc.service.attr.handler;

import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttrValue;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.attr.handler.AbstractAttrHandler;

/**
 * @Classname ThroughModelAttrHandler
 * @Description 穿透模式
 * @Author zhang.song
 * @Date 2022-03-14 18:11
 */
public class ThroughModelAttrHandler extends AbstractAttrHandler<KiteInst, AttrData> {

    /**
     * 穿透模式，删除 1_0000260-无，枚举值，翻译存量数据中的枚举值
     * @author zhang.song
     * @date 2022-03-17 16:44
     */
    @Override
    public String getValueDesc(KiteAttr attr, KiteInst inst, String value, AttrData data) {
        KiteAttrValue kiteAttrValue = this.getKiteAttrByvalue(attr, attr.getValue());
        if (kiteAttrValue != null) {
            return kiteAttrValue.getAttrValueName();
        } else if("1_0000260".equals(value)) {
            return "无";
        }
        return attr.getValue();
    }
}
